package gui;

import facade.CrossRoadInfo;

import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Ellipse2D;


public class DisplayedCrossRoad extends DisplayedTrafficInfrastructure {

	public DisplayedCrossRoad(CrossRoadInfo info) {
		this.crossRoad = info;
	}
	
	private final CrossRoadInfo crossRoad;
	
	private Ellipse2D getShape() {
		double x = crossRoad.position.getX();
		double y = crossRoad.position.getY();
		Ellipse2D circle = new Ellipse2D.Double(x-0.5,y-0.5,1.0,1.0);
		return circle;
	}
	
	@Override
	public void draw(Graphics2D g2d) {
		Shape crossroadShape = getShape();
		g2d.draw(crossroadShape);
		drawCar(g2d, crossRoad.car, crossroadShape, crossRoad.position);
		drawStringMoved(g2d, crossRoad.id, crossRoad.position);
	}

}
